/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 81557
 * Date: 2025-05-31
 * Time: 下午4:06
 *///TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int[] arr = {9, 5, 7, 15, 99, 88, 420, 66, 0, -1, -3, 9, 0, 0, 8};
        Scanner sc = new Scanner(System.in);
        int target = sc.nextInt();
        Arrays.sort(arr);
        findTwoSumPreprocessed(arr, target);
    }
    public static void findTwoSumPreprocessed(int[] arr,int target){
        // 使用双指针在已排序数组中查找
        int left = 0, right = arr.length - 1;
        while (left < right) {
            int sum = arr[left] + arr[right];
            if (sum == target) {
                System.out.println("找到符合条件的元素对：" + arr[left] + " + " + arr[right] + " = " + target);
                return;
            } else if (sum < target) {
                left++;
            } else {
                right--;
            }
        }
        System.out.println("没找到符合条件的元素对");
    }
    public static void main18(String[] args) {
        int[] arr = {9, 5, 7, 15, 99, 88, 420, 66, 0, -1, -3, 9, 0, 0, 8};
        for (int i = 0; i < arr.length - 1; i++) {
            boolean flag = true;
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                    flag = false;
                }
            }
            if (flag) {
                break;
            }
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main17(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int left = 0, right = arr.length - 1;
        while (left <= right) {
            int mid = left + (right - left) / 2;
            if (n > arr[mid]) {
                left = mid + 1;
            } else if (n < arr[mid]) {
                right = mid - 1;
            } else {
                System.out.println(mid);
                return;
            }
        }
        System.out.println("没找到");
    }

    public static void main16(String[] args) {
        int[] arr = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
        int left = 0, right = arr.length - 1;
        while (left < right) {
            if (arr[right] % 2 != 0) {
                int temp = arr[right];
                arr[right] = arr[left];
                arr[left] = temp;
                left++;
            } else {
                right--;
            }
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main15(String[] args) {
        int[] arr = {7, 87, 9, 4, 1, 9};
        System.out.println(myStrngTo(arr));
    }

    public static String myStrngTo(int[] arr) {
        if (arr == null) {
            return "null";
        }
        String res = "[";
        for (int i = 0; i < arr.length; i++) {
            res += arr[i];
            if (i != arr.length - 1) {
                res += ',';
            }
        }
        res += ']';
        return res;
    }

    public static void main14(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        System.out.println(avg(arr));
    }

    public static double avg(int[] arr) {
        double sum = 0;
        for (int x : arr) {
            sum += x;
        }
        return sum / arr.length;
    }

    public static void main13(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = i + 1;
        }
        System.out.println(Arrays.toString(arr));
        transform(arr);
        System.out.println(Arrays.toString(arr));
    }

    public static void transform(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] *= 2;
        }
    }

    public static void main12(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = i + 1;
        }
        printArray(arr);
    }

    public static void printArray(int[] arr) {
        System.out.println(Arrays.toString(arr));
    }

    public static void main11(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = i + 1;
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main10(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};
        System.out.println(sum(arr));
    }

    public static int sum(int[] arr) {
        int sum = 0;
        for (int x : arr) {
            sum += x;
        }
        return sum;
    }

    public static void main9(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(fool(n));
    }

    public static int fool(int n) {
        if (n <= 9) {
            return n;
        } else {
            return fool(n / 10) + n % 10;
        }
    }

    public static void main8(String[] args) {
        System.out.println(max(1, 2));
        System.out.println(max(max(3, 9), 7));
    }

    public static int max(int a, int b) {
        return a > b ? a : b;
    }

    public static int max(int a, int b, int c) {
        return max(max(a, b), c);
    }

    public static void main7(String[] args) {
        System.out.println(sum(1, 2));
        System.out.println(sum(1.5, 1.3, 6));
    }

    public static int sum(int a, int b) {
        return a + b;
    }

    public static double sum(double a, double b, double c) {
        return a + b + c;
    }

    public static void main6(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = 0, b = 1, c = 1;
        if (n == 0) {
            System.out.println(a);
            return;
        } else if (n == 1) {
            System.out.println(b);
            return;
        }
        for (int i = 1; i < n; i++) {
            c = a + b;
            a = b;
            b = c;
        }
        System.out.println(c);
    }

    public static void main5(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int sum = 0;
        int tmp = 1;
        for (int i = 1; i <= n; i++) {
            tmp *= i;
            sum += tmp;
        }
        System.out.println(sum);
    }

    public static int facSum(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += fac(i);
        }
        return sum;
    }

    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(fac(n));
    }

    public static int fac(int n) {
        int ret = 1;
        for (int i = 1; i <= n; i++) {
            ret = ret * i;
        }
        return ret;
    }

    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        System.out.println(max3(a, b, c));
    }

    public static int max2(int a, int b) {
        return a > b ? a : b;
    }

    public static int max3(int a, int b, int c) {
        return max2(max2(a, b), c);
    }

    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j || (j == n - i - 1)) {
                    System.out.print('*');
                } else {
                    System.out.print(' ');
                }
            }
            System.out.println();
        }
    }

    public static void main1(String[] args) {
        double sum = 0;
        int flag = 1;
        for (double i = 1; i <= 100; i++) {
            sum += flag * (1.0 / i);
            flag *= -1;
        }
        System.out.println(sum);
    }
}